$(document).ready(function() {
	
		$.getJSON("json/locat.json", function(data) {
			var locat = data["url"];
			var originalID = data["originalID"];
			$.ajax(locat + '/appClient/toAppReg', {
				dataType: 'json',
				type: 'POST',
				data: {
					'originalID': originalID
				},
				timeout: 10000,
				xhrFields: {
					withCredentials: true,
					useDefaultXhrHeader: false
				},
				crossDomain: true,
				success: function(data) {
					jQuery("#select").empty();
					for(i = 0; i <= data["jsonDocFactories"].length - 1; i++) {
						document.getElementById("select").options.add(new Option(
							data["jsonDocFactories"][i]["factoryName"] , data["jsonDocFactories"][i]["id"]));
					}
				},
				error: function() {
					swal("服务或网络异常，稍后再试！", "", "error");
				}

			})

		})

})